package exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        FileOutputStream fos = null;
        try{
            fos = new FileOutputStream("lee.txt");
        }catch (IOException e){
            System.out.println("出了个异常我也懒得整");
        }finally {
            try {
                if (fos!=null)
                fos.close();
            } catch (Exception e) {
                System.out.println("又出了个异常我还是懒得整");
            }
            System.out.println("程序结束了");
        }
    }
}
